package org.gw.ylc.base.data;

import org.gw.ylc.base.util.StringArrayUtil;

import java.util.List;

public class CommonQuery {
	public boolean page;
	public boolean single;
	public String idProperty;
	public Object[] id;
	public String entity;
	public String alias;
	private String[] customFileds;
	public List<Condition> conditions;
	private List<Order> orders;
	private List<JoinQuery> joinQuerys;

	public CommonQuery() {
	}

	public boolean isPage() {
		return page;
	}

	public String[] getCustomFileds() {
		return customFileds;
	}

	public void setCustomFileds(String[] customFileds) {
		this.customFileds = customFileds;
	}

	public void setPage(boolean page) {
		this.page = page;
	}

	public boolean isSingle() {
		return single;
	}

	public void setSingle(boolean single) {
		this.single = single;
	}

	public String getIdProperty() {
		return idProperty;
	}

	public void setIdProperty(String idProperty) {
		this.idProperty = idProperty;
	}

	public Object[] getId() {
		return id;
	}

	public void setId(Object[] id) {
		this.id = id;
	}

	public String getEntity() {
		return entity;
	}

	public void setEntity(String entity) {
		this.entity = entity;
	}

	public String getAlias() {
		if (alias == null) {
			alias = StringArrayUtil.lowerCaseFirst(entity);
		}
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public List<Condition> getConditions() {
		return conditions;
	}

	public void setConditions(List<Condition> conditions) {
		this.conditions = conditions;
	}

	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public List<JoinQuery> getJoinQuerys() {
		return joinQuerys;
	}

	public void setJoinQuerys(List<JoinQuery> joinQuerys) {
		this.joinQuerys = joinQuerys;
	}

}